import { Task } from "../../app_base/module/task/Task";
import { app } from "../../base";

/**
 * 加载主场景场景
 */
 export class TaskLoadNextScene extends Task{
    private _logLabel:string;
    /**
     * 开始加载主场景场景
     * @param nextScenePath 场景地址
     */
    start(nextScenePath:string): void {
        this._logLabel = `[预加载-加载场景] ${nextScenePath} ...done`;
        console.time(this._logLabel);
        app.res.preLoadScene(nextScenePath, this);
    }

    onComplete(): void {
        console.timeEnd(this._logLabel);
        super.onComplete();
    }
}